-- CALC_SKY_FIGHTER_SPEED
-- 战队的速度

return function(fighter)
    local speed = fighter.dbase:query("speed", 0);

    -- 速度+N
    local prop = PropM.combine(fighter, "attrib2", "speed");
    speed = PropM.apply(prop, speed);

    speed = speed + SkyShipSkillM.calcAddon(fighter, "speed", speed);

    speed = speed + SkyPropM.calcAddon(fighter, "speed", speed);

    -- 速度+N（不参与前面的整体提升）
    prop = PropM.combine(fighter, "add_attrib", "speed");
    speed = PropM.apply(prop, speed);

    -- 降低速度N
    prop = PropM.combine(fighter, "ship_reduce_attrib", "speed");
    speed = PropM.apply(prop, speed);

    -- 迟缓状态，速度为0
    prop = PropM.combine(fighter, "slow", 1);
    if PropM.apply(prop, speed) > 0 then
        speed = 0;
    end

    if speed < 0 then
        speed = 0;
    end

    return speed;
end
